//@ts-ignore
import * as Vue from "vue";
//@ts-ignore
import { debounce } from "./debounce";
//@ts-ignore
import { eventtarget } from "./eventtarget"; //@ts-ignore
//@ts-ignore
import loadpage from "./loadpage.cjs";

//@ts-ignore

export const routerpagegethandler = debounce(async () => {
    // console.log("loading", location.hash);
    await loadpage();

    await Vue.nextTick();
    requestAnimationFrame(() => {
        //@ts-ignore
        requestIdleCallback(() => {
            eventtarget.dispatchEvent(new Event("load"));
        });
    });
});
